package com.arvin.mapper;

import com.arvin.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper {
    //根据用户名查找
    @Select("select * from t_stuinformation where student_id= #{studentId}")
    User findByUsername(String studentId);
    //插入用户信息
    @Insert("insert into t_stuinformation(student_id,password,email,class_name,create_time,update_time)" +
            " values(#{studentId},#{password},#{email},#{className},now(),now())")
    void add(String studentId, String password,String email,String className);

    //更新用户密码
    @Update("update t_stuinformation set password = #{md5String},update_time = now() where student_id= #{studentId}")
    void updatePwd(String md5String, String studentId);
}
